<!DOCTYPE html>
<html>
<head lang="cn">
     <%
    include("/common/inc/meta.html"){}
    %>
    <title>登录</title>
    <style>
        .header {
            text-align: center;
        }
        .header h1 {
            font-size: 200%;
            color: #333;
            margin-top: 30px;
        }
        .header p {
            font-size: 14px;
        }
    </style>
</head>
<body>
<div class="header">
    <div class="am-g">
        <h1>任帅鹏权限管理系统</h1>
        <p>来吧<br/>看看，学学</p>
    </div>
    <hr />
</div>
<div class="am-g">	
    <div class="am-u-lg-6 am-u-md-8 am-u-sm-centered">
        <h3>登录</h3>
        <hr>
        <div class="am-btn-group">
            <a href="#" class="am-btn am-btn-secondary am-btn-sm"><i class="am-icon-github am-icon-sm"></i> Github</a>
            <a href="#" class="am-btn am-btn-success am-btn-sm"><i class="am-icon-google-plus-square am-icon-sm"></i> Google+</a>
            <a href="#" class="am-btn am-btn-primary am-btn-sm"><i class="am-icon-stack-overflow am-icon-sm"></i> stackOverflow</a>
        </div>
        <br>
        <br>
        <%if(error!'' != ''){%>
		<div class="am-alert am-alert-warning" data-am-alert>
			  <button type="button" class="am-close">&times;</button>
			  <p>${error!}</p>
		</div>
		<%}%>
        <form method="post" class="am-form">
            <label for="loginName">用户名:</label>
            <input type="text" name="loginName" value="${loginName!''}" minlength="3" placeholder="输入用户名（至少 3 个字符）" required>
            <br>
            <label for="loginPwd">密码:</label>
            <input type="password" name="loginPwd" >
            <br>
            <label for="remember-me">
            	<input type="hidden" name="token" value="${session.token!}">
                <input id="remember-me" type="checkbox">
                记住密码
            </label>
            <br />
            <div class="am-cf">
            	<input type="hidden" value="${token!}" name="token">
                <button type="submit" id="btnLogin" class="am-btn am-btn-primary am-btn-sm am-fl">登 录</button>
                <a type="button" id="btnResetPwd" class="am-btn am-btn-default am-btn-sm am-fr" href="${ctxPath}/forgetPwd">忘记密码 ^_^? </a>
            </div>
        </form>        
        <hr>
        <p>© 2014 AllMobilize, Inc. Licensed under MIT license.</p>
    </div>
</div>

<%
    include("/common/inc/js.html"){}
    %>
<script>
    $(function(){
    	//$('#btnLogin').click(function(){      
    	//	loginTo();
    	//})
    })

    function loginTo() {
        var handlerError = new AjaxError("1", "http://www.baidu.com");
        var logName = $("#loginName").val();
        var loginPwd = $("#loginPwd").val();
        var data = {"loginName": logName, "loginPwd": loginPwd};
        new AjaxUtil(handlerError).Post("/login", data);
    }
</script>
</body>
</html>
